package com.docMan.service;

import java.io.File;
import java.util.List;

import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import com.docMan.dao.pojo.DocBookSon;

@Path("/DocBookSon")
@Produces({MediaType.APPLICATION_JSON})
public interface DocBookSonService extends BaseService<DocBookSon> {
	
	@POST
	@Path("/addBookSon")
	@Produces({MediaType.APPLICATION_JSON})
	abstract String addBookSon(@FormParam("bookSonTitle")String bookSonTitle,@FormParam("fatherBookId")int fatherBookId,@FormParam("filePaths")List<String> filePaths);
	
	@POST
	@Path("/addBookSonDirectory")
	@Produces({MediaType.APPLICATION_JSON})
	abstract String addBookSonOnly(@FormParam("bookSonTitle")String bookSonTitle,@FormParam("bookSonId")int bookSonId,
			@FormParam("fatherId")int fatherId,
			@FormParam("orderId")int orderId,
			@FormParam("isDirectory")int isDirectory);
	
	@GET
	@Path("/getBookSon/{bookSonId}")
	@Produces({"application/pdf",MediaType.APPLICATION_JSON})
	abstract File getBook(@PathParam("bookSonId")int bookSonId);
	
	@POST
	@Path("/delBookSon")
	abstract String delBookSon(@FormParam("bookSonId")int bookSonId);
	
	@POST
	@Path("/editBookSon")
	abstract String editBookSon(@FormParam("bookSonId") int bookSonId,@FormParam("bookSonName")String bookSonName,@FormParam("orderId")int orderId);
	
	@POST
	@Path("/getSubBookSon")
	abstract String getSubBookSon(@FormParam("bookSonId") int bookSonId);
	
	@POST
	@Path("/getFatherBookSon")
	abstract String getFatherBookSon(@FormParam("fatherBookId")int fatherId);
	
	@POST
	@Path("/getBookSonDirectoryByFatherId")
	abstract String getBookSonByFatherBookId(@FormParam("fatherBookId") int fatherId);
	@POST
	@Path("/setBook")
	abstract String setBook(@FormParam("filePaths") List<String> filePaths
			,@FormParam("bookSonId")int bookSonId
			,@FormParam("fatherBookId")int fatherBookId
			,@FormParam("isDirectory")int isDirectory);
	
}
